# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=havn
pkgver=0.1.10
pkgrel=0
pkgdesc="A fast configurable port scanner with reasonable defaults"
url="https://github.com/mrjackwills/havn"
arch="all"
license="MIT"
makedepends="
	cargo
	cargo-auditable
	"
source="https://github.com/mrjackwills/havn/archive/v$pkgver/havn-$pkgver.tar.gz"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	# Disabled tests require extra permissions.
	cargo test --frozen -- \
		--skip scanner::tests::test_scanner_1000_80_443 \
		--skip scanner::tests::test_scanner_1000_empty \
		--skip scanner::tests::test_scanner_all_80 \
		--skip scanner::tests::test_scanner_port_80 \
		--skip terminal::print::tests::test_terminal_monochrome_false
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
5f9b44e3f36d5ad14863e919819822671151a39dcf6b2a8a40ab589326e8a890be4161d9b60ebfbc2e4a17a72be41175522d8793e252bbe990ad15c2c2e88617  havn-0.1.10.tar.gz
"
